﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace DailyRssDownload.Lib {
	[Serializable]
	public class FeedCollection : List<Feed> {
		public FeedCollection() : base() { }

		public FeedCollection(int intCapacity) : base(intCapacity) { }

		public FeedCollection(IEnumerable<Feed> feeds) : base(feeds) { }

		public static FeedCollection ConvertFeedsToFeedCollection(RssFeedCollection objRssFeedCollection, AtomFeedCollection objAtomFeedCollection) {
			int RssFeedCount = (objRssFeedCollection == null ? 0 : objRssFeedCollection.Count);
			int AtomFeedCount = (objAtomFeedCollection == null ? 0 : objAtomFeedCollection.Count);

			FeedCollection objFeedCollection = new FeedCollection(RssFeedCount + AtomFeedCount);
			if (objRssFeedCollection != null)
				foreach (RssFeed objRssFeed in objRssFeedCollection)
					objFeedCollection.Add(objRssFeed);
			if (objAtomFeedCollection != null)
				foreach (AtomFeed objAtomFeed in objAtomFeedCollection)
					objFeedCollection.Add(objAtomFeed);
			return objFeedCollection;
		}
	}
}
